const mongoose = require("mongoose");
const modelSchema = new mongoose.Schema(
  {
    name: {
      type: String,
      required: true, // 必填
    },
    img: {
      type: String,
      // default: 'http://pic2.iqiyipic.com/image/20201215/6f/c3/v_108792444_m_601_m9.jpg'
    },
    playUrl: {
      type: String,
    },
    views: {
      type: Number,
      default: 20,
    },
    story: {
      type: String,
    },

  },
  {
    timestamps: true, // 为数据库中的每一条记录添加一个创建和修改时间
  }
);

const Movie = mongoose.model("movie", modelSchema);
module.exports = Movie;
